package com.swsc.ai.enums;

public enum TFEnum {
    //测试模式
    TRUE("1", false), //
    FALSE("0", true);

    private String name;
    private boolean val;

    // 构造方法
    private TFEnum(String name, boolean val) {
        this.name = name;
        this.val = val;
    }

    public String getName() {
        return name;
    }

    public boolean getVal() {
        return val;
    }

    public static TFEnum fromTypeName(String typeName) {
        for (TFEnum mode : TFEnum.values()) {
            if (mode.getName().equals(typeName)) {
                return mode;
            }
        }
        return null;
    }

    //覆盖方法
    @Override
    public String toString() {
        return this.val + "_" + this.name;
    }
}
